home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Newsletters / GEnieUnixNews / unxnl-02.92 < prev    next >
Text File  |  1992-12-27  |  24KB  |  470 lines

  1.                             
  2.           _  _  _   _  _   _
  3.          // // //| // // \//     N E W S
  4.         //_// // |// //  /\\     Vol 3, Issue 2 - February 1992
  5.       R o u n d T a b l e (tm)
  6.                                  
  7.    Items of interest to participants of the GEnie Unix RoundTable
  8.                               
  9.        The RoundTable SysOps are:
  10.        Andy Finkenstadt....ANDY       Rick Mobley.........LRARK
  11.        Gary Smith..........GARS       Brian Riley.........DELPHI
  12.                    All Unix SysOps.....UNIXSYSOPS$
  13.    We strongly encourage you to contact any or all of us if you have -ANY-
  14.  comments or suggestions. This is -YOUR- RoundTable. We are here to make
  15.  your participation as pleasant and beneficial as possible.
  16.               
  17.  ED: editor notes - added support
  18.  --
  19.                     
  20.    We are gratified by your response to the new platform specific support
  21.  areas for Sun, NeXT, Coherent and Sequent. Needless to say, the enthusiastic
  22.  response will only encourage us to continue to strive to provide a fuller
  23.  range of resources for all aspects of the operating environments included 
  24.  under the Unix umbrella.
  25.               
  26.    As library manager for the Unix RoundTable, I am especially pleased with
  27.  the increased involvement by several users in building it. Many have taken
  28.  the time to share files and I hope their efforts are as appreciated by others
  29.  as they are by me. I'm hesitant to single out any one individual or group of
  30.  individuals; but I really can't let this opportunity pass to publicly thank
  31.  A.ROSENBALM, E.TREMBLAY2, E.UYEDA for really pumping up the libraries with
  32.  goodies for NeXT. They have set quite a standard for other platform users to
  33.  try to emulate. Nice piece of work!
  34.           
  35.    Add Mike Nolan who has imported the LINUX, Gnu Unix clone for 386's with
  36.  all the support files, Irwin Shapiro who is still in the process of uploading
  37.  DJGPP, the gcc/g++ frontend for 386, and Keith Smith who posted the current
  38.  release of CRISP. 
  39.                  
  40.    One final note regarding the libraries. At the suggestion of Eric Tremblay
  41.  a new library, Library 28 THE GALLERY, has been added so that participants of
  42.  the GEnie Unix RoundTable can post their .TIFF or .GIF images of themselves,
  43.  thus drawing our community of users even closer together. This library is
  44.  for mug shots only. All other graphics files will continue to go into Library
  45.  18. Get out those scanners and let's see what you look like!
  46.              
  47.  Upload Contest Winners for Feburary  (ANDY)
  48.  -----------------------------------
  49.              
  50.  The Unix RoundTable is proud to announce the winners of the
  51.  January 1992 Upload Contest.  We have many good participants, but
  52.  three persons stood out ahead of the rest:
  53.               
  54.  Uploader     Total Bytes Uploaded   Total number of files
  55.  ------------ --------------------   ---------------------
  56.  E.TREMBLAY2         1653504               27
  57.  K.SMITH52           1604352                6
  58.  I.SHAPIRO3          1021952                3
  59.           
  60.  As winners of the January 1992 Upload Contest, Eric Tremblay will
  61.  be awarded two free days in the Unix RoundTable, and Keith Smith
  62.  and Irwin Shapiro will be awarded one day each.  Congratulations
  63.  to the three of you, and to all the persons who have benefited by
  64.  the excellent files uploaded.
  65.           
  66.  Keith uploaded the excellent CRISP editor which works a lot like
  67.  the BRIEF programmer's editor.  Irwin uploaded the MS-DOS 80386
  68.  extender and gcc compiler files, and Eric has uploaded quite a
  69.  number of NeXT workstation related files.  Great work!
  70.                   
  71.  -Andy Finkenstadt
  72.   Unix RT Sysop
  73.               
  74.  Lead Sysop Notes  (ANDY)
  75.  ----------------
  76.              
  77.  Greetings!  It's now the beginning of February as I write this
  78.  note to you.  I'd like to thank you for helping make the Unix
  79.  RoundTable one of the best places to come for information about
  80.  the operating system of the future, here today.
  81.               
  82.  There have been several changes over the last couple of months:
  83.  5 new bulletin board categories for the Sun workstation, the NeXT
  84.  workstation, the Coherent Unix-like operating system, the Sequent
  85.  multi-processor computers, and a brand-new category for
  86.  discussing topics which impact on societal and social issues.
  87.  (For example, Dick Flanagan started an amusing topic on humorous
  88.  commands you can issue.)
  89.              
  90.  Shortly after this writing the entire Unix Library Listings will
  91.  be available in one file.  They are sorted by name and encompass
  92.  files numbered 1 through 2754.  The files to look for are
  93.  UNIXLIBS.TXT and UNIXLIBS.ZIP.  Another copy as UNIXLIBS.Z will
  94.  be available soon, as well.
  95.                
  96.  Until next time,
  97.  -Andy
  98.          
  99.  System Handy Hint:  Do a shutdown!
  100.  -----------------
  101.  'SCO Magazine, The Journal for builders and Buyers of SCO Open Systems' from
  102.  CMP Publications, Inc., 600 Community Drive, Manhasset, NY  11030 made the
  103.  following observation in the November 1991 issue, pp.16 in their Pointers:
  104.                         
  105.  Reboot at least once a month or even once a week if your Unix box is really
  106.  critical to your business. The system is forced to run fsk() on the file-
  107.  systems, which cleans up any corrupted files and takes a general inventory
  108.  of everything on the disk.
  109.                
  110.  They further point out autobooting or remote booting won't get the job done.
  111.  Using cron or similar autoboots causes only a cursory scan of root, thus all
  112.  but negating the purpose of the exercise.
  113.               
  114.  WHO short bios
  115.  ---
  116.  This issue we get a closer look at a couple of our new on-line support gurus.
  117.  These are the individuals who have graciously volunteered to man the special
  118.  platform specific areas.
  119.             
  120.  Frank Cupo, NeXT support 
  121.         
  122.    As you know my name is Frank Cupo and I am a 22yr old Service  Manager for
  123.  Essex Computers in Newark, NJ. I have been interested in computers since I
  124.  was thirteen and got my first TI computer.
  125.    Since then I've owned and trashed computers from Atari, Commodore, Apple,
  126.  and Compaq.  Up untill April '91 my main focus was with the Macs and Intel
  127.  based products. Since Essex became NeXT authorized in April I have become a
  128.  dedicated NeXT support person there. I have just begun to dabble in Unix
  129.  itself, most of my time has been spent learning Objective-C. One of my other
  130.  NeXT related projects is the initiation of The NeXT Jersey Users Group,
  131.  NeXT-JUG. Some of my hobbies include Scuba Diving, Motorcycles, and racing
  132.  R.C. cars.
  133.      
  134.  Mike Perry, Sequent support
  135.      
  136.    I've been in Data Processing since 1978. Started out on a Honeywell Level
  137.  62 writing in Cobol and RPG II.  Went on to work on DG Nova systems using
  138.  Cobol then back to Honeywell DPS6 writing Cobol.
  139.                
  140.    Now I work for Sequent Computer Systems as a Regional Technical Support
  141.  Specialist.  My responsibilities include:  Benchmarking, Database Special-
  142.  ization (Ingres/Informix), and Unix knowledge.
  143.                  
  144.    I'm based in Tampa but report to the Central (Chicago) Region of the 
  145.  company.
  146.             
  147.    I have a BSCS from Tampa College (Summa) and will be starting on my MS in
  148.  the summer.  I also have a current ICCP certification as a Certified
  149.  Programmer in Commercial and Scientific languages.
  150.              
  151.    I also monitor the Sequent section of the BBS on the Unix roundtable.
  152.                      
  153.                            
  154.  FAST and NASTY, DOWN  and  DIRTY:  quick  fix scripts that do something
  155.  --------------------------------
  156.                     
  157.  Subject: Dirtiest little sh test for program existence...
  158.              
  159.  I just discovered this litte nice (:) method which kind of tests the
  160.  existence of an executable within $PATH.  It goes like this:
  161.                  
  162.  #!/bin/sh
  163.  prog=$1
  164.  if [ ! -z "$prog" ]; then
  165.          case "`(. $prog 2>&1)`" in
  166.              *"not found"*) echo $prog not found ;;
  167.              *)             echo $prog found ;;
  168.          esac
  169.  fi
  170.           
  171.  So what do you people think?  Are there shell implementations that will
  172.  puke on this one?
  173.            
  174.  --Harald E
  175.  From: Harald.Eikrem@delab.sintef.no
  176.  Newsgroups: comp.unix.shell
  177.                       
  178.  TUTORIALS:
  179.  =========
  180.             
  181.  m4(1) - a macro pre-processor     Andrew Finkenstadt (ANDY)
  182.  -----------------------------
  183.                
  184.          What is m4?
  185.  m4 is a filter that reads some files (or the standard input) and
  186.  outputs to the standard output the results of the filtering.  It
  187.  differs from most other filters in that it has some intelligence
  188.  built-in that allows it to serve as a very smart 'sed' stream
  189.  editor with simple textual substitutions (like replacing all
  190.  occurences of the word 'A' with a lower case 'a') or as complex
  191.  as making entire subroutines from simple one-line statements.
  192.  For example, the Ratfor (rational fortran) pre-compiler uses m4
  193.  to take ratfor source code and output "real" fortran code for
  194.  feeding into a real fortran compiler.
  195.  Other filters that are part of the standard Unix operating system
  196.  allow one to sort files, translate between character sets, reject
  197.  common words, and so on.  Filters are usually used as part of a
  198.  pipeline to build complex functions from smaller parts.  For
  199.  example, one common backup script uses the file find and cpio
  200.  programs and the sort and compress filters to build a very
  201.  compact backup archive which can be placed onto tape media with
  202.  minimal difficulty.
  203.  Do not confuse m4 with M-5, the computer-run-amok in Star Trek.
  204.  Even though it may seem as though your computer isn't your friend
  205.  anymore while you are learning m4, persevere and your rewards
  206.  will be great indeed.
  207.  In this first article of a series on the topic of using m4 we
  208.  explore some of the command line options given to m4 and some
  209.  simple textual substitution macros.
  210.  Many times I have wished for the ability to use the capabilities
  211.  of the C language pre-processor in other areas - especially in
  212.  Structured Query Language (SQL) database work.  Implementing the
  213.  database construct of a domain is relatively easy - but
  214.  coordinating the types and sizes of variables in different
  215.  database scripts is a pain, and information is lost by using the
  216.  base type.
  217.  An example follows:
  218.  Let's say we want to implement the standard Rolodex card on a
  219.  computer using a relational database which lets us speak to it in
  220.  SQL instead of the compiled language 'C'.  We might build one
  221.  table to hold each set of rolodex cards.  In the real world we
  222.  attempt to put as much information on one card as possible -
  223.  including multiple addresses and phone numbers.  Like this:
  224.          create table my_rolodex (
  225.                  card_number     number(5),
  226.                  company_name    char(50),
  227.                  related_company char(50),
  228.                  contact_name    char(50),
  229.                  other_name              char(50),
  230.                  address1                char(50),
  231.                  citystate1              char(30),
  232.                  zip1                    number(5),
  233.                  address2                char(50),
  234.                  citystate2              char(30),
  235.                  zip2                    number(5),
  236.                  home_phone              number(10),
  237.                  biz_phone               number(10),
  238.                  fax_phone               number(10)
  239.          );
  240.  You may notice that we have allocated space for each field, and
  241.  that it just so happens that the amount of space allocated for a
  242.  person's name is the same as for a company.  Great!  At least we
  243.  are consistent.
  244.  Now you finish your beautiful rolodex application and your most
  245.  trusted colleague comes to you and says there are some problems.
  246.  First he needs just a couple more characters for the company
  247.  name.  Secondly he points out that many companies have extensions
  248.  on their phone numbers.  And finally your beloved friend tells
  249.  you that you forgot all about the zip+4 9-digit encoding used by
  250.  the post office and canadian zip codes which have letters in
  251.  them.  Yikes!  At least he didn't tell you that your shoes were
  252.  ties wrong.
  253.  As you begin to look at the rolodex table you see that you could
  254.  just use vi and replace all occurences of char(50) with char(60)
  255.  for the company names, number(5) with char(9) for the zip codes,
  256.  and number(10) with number(15) for the phone numbers - surely no
  257.  company has more than 5 digits in an extension.
  258.  Unfortunately this will also change fields that you would rather
  259.  not touch: the name columns and the card number field.  So we
  260.  quickly figure out a different method to maintain substitutions
  261.  like this.
  262.          m4 to the rescue.
  263.          =================
  264.  Instead of coding the finaly storage types directly in the SQL
  265.  language for each column, we resort to using an artificial term
  266.  whereever we have something which might change in the future. For
  267.  example, our new rolodex table might look like this:
  268.          create table my_rolodex (
  269.                  card_number     domain_cardnumber,
  270.                  company_name    domain_company,
  271.                  related_company domain_company,
  272.                  contact_name    domain_name,
  273.                  other_name              domain_name,
  274.                  address1                domain_address,
  275.                  citystate1              domain_city,
  276.                  zip1                    domain_zip,
  277.                  address2                domain_address,
  278.                  citystate2              domain_city,
  279.                  zip2                    domain_zip,
  280.                  home_phone              domain_phone,
  281.                  biz_phone               domain_phone,
  282.                  fax_phone               domain_phone
  283.          );
  284.  Alas, unless your SQL database engine supports domains running
  285.  this script through your engine probably results in an error.  We
  286.  need to use m4 first to create the real script before feeding
  287.  THAT to the engine.
  288.  Here is the sql.m4 file used to create the original SQL script.
  289.          define(domain_zip,number(5))
  290.          define(domain_address,char(50))
  291.          define(domain_city,char(30))
  292.          define(domain_phone,number(10))
  293.          define(domain_cardnumber,number(5))
  294.          define(domain_company,char(50))
  295.          define(domain_name,char(50))
  296.  Notice that we have used the built-in 'define' macro to define a
  297.  substitution for each of the domains we have established.
  298.          $ m4 sql.m4 myrolodex.m4
  299.          create table my_rolodex (
  300.                  card_number     number(5),
  301.                  company_name    char(50),
  302.                  related_company char(50),
  303.                  contact_name    char(50),
  304.                  other_name              char(50),
  305.                  address1                char(50),
  306.                  citystate1              char(30),
  307.                  zip1                    number(5),
  308.                  address2                char(50),
  309.                  citystate2              char(30),
  310.                  zip2                    number(5),
  311.                  home_phone              number(10),
  312.                  biz_phone               number(10),
  313.                  fax_phone               number(10)
  314.          );
  315.  Changing the definitions of the domains, and re-running the m4
  316.  command given above, results in the updated SQL language script.
  317.  Too easy, right?  Right.
  318.  Domains aren't so important on the example given here (limited in
  319.  size due to article length), but on a production database system
  320.  you may have more than 100 tables, each with its own copy of the
  321.  domain you established.  Can you imagine finding and changing
  322.  accurately each of the references to a zip code domain two months
  323.  into the project when the post office expands zip+4 into delivery
  324.  point barcode and 6-digit add-on codes instead of 4.  (True,
  325.  believe it or not.)  Relational database systems are notorious
  326.  for creating many hundreds of cross-references between tables and
  327.  coordinating these cross-references without domains is asking for
  328.  trouble.  m4 helps out here.
  329.  The built-in 'define' macro also accepts positional parameters
  330.  like a C program or shell script can.  You can refer to these
  331.  parameters in your macro by using the $n, where 'n' is the n'th
  332.  parameter inside the parentheses.  Like this:
  333.          define(new_table,create table $1)
  334.  Now invoke it:
  335.          new_table(my_rolodex) (
  336.                  ...
  337.  The output is as followed:
  338.          create table my_rolodex (
  339.                  ...
  340.          Caveat Emptor
  341.          =============
  342.  Beware of some interesting behaviour while within m4.
  343.  Unintentionally using a pre-defined macro can have unexpected
  344.  side-effects.  For example the very common SQL object 'index' is
  345.  also defined in m4 for taking the index of a string.  Here are
  346.  the pre-defined words included in the root m4 program... your
  347.  mileage may vary.
  348.          define, undefine, defn, pushdef, popdef, ifdef, shift,
  349.          changequote, changecom, divert, undivert, divnum, dnl,
  350.          ifelse, incr, decr, eval, len, index, substr, translit,
  351.          include, sinclude, syscmd, sysval, maketemp, m4exit,
  352.          m4wrap, errprint, dumpdef, traceon, traceoff
  353.  As you can imagine from the list of defined words, some pretty
  354.  powerful flexibility is inherent within m4(1).  We will be
  355.  exploring this great tool in future articles.
  356.  Best wishes.
  357.                   
  358.  KSH - Features and extensions   (DELPHI) Brian T. Riley
  359.  -----------------------------
  360.               
  361.         Hello again boys and girls. Last month fellow Sysops ANDY and 
  362.  GARS showed you a few things about the C shell and using "vi" for 
  363.  editing files. In addition, LRARK discussed some of the basics of 
  364.  programming in the Bourne (sh) shell. However, some of you may be 
  365.  saying, "I use the Korn Shell! What about me!?". Well fear not! The 
  366.  Korn shell is a super set of the Bourne Shell so every thing Rick 
  367.  (LRARK) showed you will work the same way! The Korn shell adds a few 
  368.  more features that we will explore later when you are more comfortable 
  369.  with the basics of shell programming. For now we will concentrate on 
  370.  changing your prompt like in the C shell and using "vi" editing mode 
  371.  for the command line. 
  372.               
  373.                         Changing your Prompt:
  374.               
  375.          When you first start using the Korn shell, or any shell for 
  376.  that matter, it doesn't tell you a lot about where you are. In fact, 
  377.  it doesn't tell you anything other than the fact that it wants another 
  378.  command! Well, we can fix that! ::smile:: Fortunately, with the Korn 
  379.  shell it is much easier than the C shell. This time we will make KSH 
  380.  tell us where we are and also how many commands we have executed this 
  381.  session. 
  382.                
  383.          The first thing we need to do is make sure we have a .kshrc 
  384.  file to hold this information so we don't have to do this every time 
  385.  we log on. The .kshrc is the Korn shell equivalent of the C shells' 
  386.  .cshrc file and should be in your HOME directory with your .profile. 
  387.  If you don't have one already, you can create one using Vi or have 
  388.  your system administrator do it for you. You also will need the 
  389.  following entry in your .profile.
  390.              
  391.  ENV=$HOME/.kshrc
  392.              
  393.          Now we need to add (or modify) a line in the .kshrc file like 
  394.  this:
  395.             
  396.  PS1='$PWD '"! $ "
  397.               
  398.          This tells Ksh that we are changing the primary prompt (PS1) 
  399.  to include the current directory ('$PWD') and the number of commands 
  400.  executed (!) so far. The ' ' tell the shell to expand the environment 
  401.  variable $PWD to it's current value which just happens to be the 
  402.  current directory! :) Be sure to type everything to the right of the = 
  403.  exactly or it won't work! Now every time the shell displays the prompt 
  404.  it will show us where we are. The second part (!) shows us how many 
  405.  commands we have executed. We can use this information when we want to 
  406.  recall a previous command and possibly edit it. Your prompt should 
  407.  look something like this:
  408.                
  409.  /u/brian 5 $_
  410.               
  411.                          Command line editing:
  412.                   
  413.           In a previous edition of this newsletter I discussed Command 
  414.  line editing with the Korn shell. Due to limited space I won't go over 
  415.  it in detail again, but expand it instead. Basically, all of the 
  416.  commands Gary (GARS) showed you in the last issue are valid here, with 
  417.  one notable exception. When editing a command line you must remember 
  418.  that you are looking at a one line window that is showing you the 
  419.  contents of the HISTORY file. This means that you won't see the ":" 
  420.  when you press ESC, nor will you see the "~" either. When you get to 
  421.  the last line in the HISTORY file the terminal will just beep (or 
  422.  flash) and it won't go any farther. This will also happen if you go to 
  423.  the first available command line in the file, which is set by the 
  424.  HISTSIZE= variable. Let me point out that the (!) in your prompt will 
  425.  show you ALL of the commands in the HISTORY file even if you can't 
  426.  recall all of them! To recap, these commands work this way when you 
  427.  are editing/recalling a command;
  428.                
  429.  h - move one character to the left
  430.  j - display next command in the HISTORY file
  431.  k - display previous command in HISTORY file
  432.  l - move one charter to the right
  433.  0 - move to beginning of line
  434.  $ - move to end of line
  435.        
  436.  i,I,a,A - same as when editing a file
  437.  o,O - are not used in command editing 
  438.       
  439.  G - moves to the last command in the HISTORY file
  440.             
  441.          Well, that's it for this time, but, feel free to ask me for 
  442.  help with anything you don't understand and I'll see you next time! :)
  443.              
  444.  Brian
  445.                   
  446.  ---------------    
  447.    REMINDER - This newsletter is being sent to you 'by request'. If you do
  448.  not wish to keep receiving it, e-mail a stop notice to GARS. On the other
  449.  hand, we would very much appreciate it if you would pass the word that we
  450.  do distribute this item near the tenth (10th) of the month of issue to any-
  451.  one on GEnie who requests it, and will gladly add any name that is requested
  452.  via the same route... e-mail to GARS.
  453.    P L E A S E  also remember contributions are most welcome. Please e-mail
  454.  items and/or suggestions to GARS.
  455.                                      
  456.  (EOF)
  457.                                   
  458.   Trademark and Copyright notices:
  459.   Unix is a Trademark of UNIX System Laboratories, Inc.; GEnie, LiveWire, and
  460.   RoundTable are Trademarks of General Electric Information Services  Company;
  461.   Xenix and ms-dos are Trademarks of  Microsoft  Corporation; NeXT and NeXTstep
  462.   are Trademarks of NeXT Computer Systems, Inc., Coherent is a Trademark of 
  463.   Mark Williams Company, Sun is a Trademark of Sun Microsystems, Inc, Sequent
  464.   is a Trademark of Sequent Computer Systems, Inc. 
  465.                                   
  466.  The contents of this newsletter are copyright (c) 1992 and may be copied whole
  467.  or in part only if  original  credit is included. The GEnie UNIX RoundTable is
  468.  not affiliated with AT&T or UNIX System Laboratories, Inc.
  469.  
  470.